package day7;

import day6.pet.Dog;
import day6.pet.Penguiun;

/**
 * @author oldliu
 * @since 1.0
 */
public class ObjDog {
    public static void main(String[] args) {
        //Object o = new Dog("大黄", 70, 67, "公", "狼狗");
        Object o=new Penguiun("小蓝企鹅",60,80,"公");
        System.out.println(o);
        //o.print():
        if(o instanceof Dog){
            System.out.println("这个对象是条狗");
            Dog dog = (Dog) o;
            dog.print();
            dog.grap(new Mouse("米奇",1000));
        }else if(o instanceof Penguiun){
            System.out.println("这个对象是一只企鹅");
            Penguiun p= (Penguiun) o;
            p.print();
            p.swim();//
        }



    }
}
